package top.scsoul.voes.common.core.domain.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

/**
 * (User)实体类
 *
 * @author guolei
 * @since 2021-08-8 00:13:23
 */
public class User implements Serializable {
    private static final long serialVersionUID = 227036666968957892L;
    /**
     * id
     */
    @Excel(name = "id")
    private Integer id;
    /**
     * 登录名
     */
    @Excel(name = "用户名")
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 真实姓名
     */
    @Excel(name = "真实姓名")
    private String name;
    /**
     * 性别
     */
    @Excel(name = "性别", replace = {"男_1", "女_2"})
    private Integer gender;
    /**
     * 身份证号码
     */
    @Excel(name = "身份证号码", width = 25)
    private String idCard;
    /**
     * 电话号码
     */
    @Excel(name = "电话号码")
    private String phone;
    /**
     * 状态
     */
    @Excel(name = "状态", replace = {"正常_1", "停用_2"})
    private Integer state;
    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 25, format = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date created;

    private List<Role> roles;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", gender=" + gender +
                ", idCard='" + idCard + '\'' +
                ", phone='" + phone + '\'' +
                ", state=" + state +
                ", created=" + created +
                ", roles=" + roles +
                '}';
    }
}